/*
 *  RK.cpp
 *  T3nsors
 *
 *  Created by Michael Barriault on 10-10-01.
 *  Copyright 2010 MikBarr Studios. All rights reserved.
 *
 */

#include "RK.h"
#include <T3nsors/Domain.h>
#include <T3nsors/Macros.h>
#include <cstdio>

void T3::RK::Evolve(T3::Set& x, double dt) {
	T3::Set dx1 = Dots(x);
	T3::Set x2 = LinCom(1., x, 0.5*dt, dx1);
	Mod(x2);
	T3::Set dx2 = Dots(x2);
	T3::Set x3 = LinCom(1., x, 0.75*dt, dx2);
	Mod(x3);
	T3::Set dx3 = Dots(x3);
	T3::Set dx = LinCom(2*dt/9, dx1, 3*dt/9, dx2, 4*dt/9, dx3);
	x += dx;
//	x = LinCom(1., x, 2*dt/9, dx1, 3*dt/9, dx2, 4*dt/9, dx3);
	Mod(x);
}

T3::Set T3::RK::Dots(T3::Set x) {
	return x;
}

void T3::RK::Mod(T3::Set& x) {
	return;
}
